<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>
    autoCompleteClinic("clinicItemDict");
    function autoCompleteClinic(inputId){
        var url="${ctx}/oper/clinicItemDict/automatic?itemClass=C&extId=${labType.clinicItemDictLists}";
        autoComplete(inputId,url,
                function(data){
                    var rows = [];
                    for(var i=0; i<data.length; i++){
                        rows[rows.length] = {
                            data:data[i],
                            value:data[i].id,
                            result:data[i].itemName
                        };
                    }
                    return rows;
                },function(data, i, max){
                    return data.itemName+"|"+data.itemCode+"|"+data.price;
                },function(event, data,formatted){
                   $("#clinicId").val(data.id);
                })
    }
</script>
<div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li>
                    <a href="#"  onclick="loadDiv('mainCenterDiv','${ctx}/oper/labVsClinic/labVsClinicList')">检验类型列表</a>
                </li>
                <li class="active">
                    <a href="#" onclick="loadDiv('rigthCenterDiv','${ctx}/oper/labVsClinic/labVsClinicForm')">
                        <c:choose>
                            <c:when test="${labVsClinic.id==''|| labVsClinic.id==null}">
                                检验项目添加
                            </c:when>
                            <c:otherwise>检验项目修改</c:otherwise>
                        </c:choose>
                    </a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="col-lg-12">
                        <form:form id="inputForm" data-parsley-validate ="" modelAttribute="labVsClinic" onsubmit="return formSaveLoad('mainCenterDiv','inputForm','${ctx}/oper/labVsClinic/saveLabItem','${ctx}/oper/labVsClinic/labVsClinicList?labTypeId=${labType.id}');" method="post" class="form-horizontal">
                            <form:hidden path="id"/>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">检验类型：</label>
                                    <div class="col-sm-4">
                                        <form:hidden path="labType.id"></form:hidden>
                                        <form:input  path="labType.name"  id="labId" data-parsley-required="true" htmlEscape="false" class="form-control"  maxlength="64" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">诊疗项目：</label>
                                    <div class="col-sm-4">
                                        <form:hidden path="clinicItemDict.id" id="clinicId"></form:hidden>
                                        <form:input path="clinicItemDict.itemName" id="clinicItemDict"   data-parsley-required="true" htmlEscape="false" class="form-control"  maxlength="50" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">项目标本：</label>
                                    <div class="col-sm-4">
                                        <form:select path="specimen" class="form-control" data-parsley-required="true">
                                            <form:option value="" label=""/>
                                            <form:options items="${fns:getDictList('SPECIMAN_DICT')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                                        </form:select>
                                        <%--<form:hidden path="clinicItemDict.id" id="clinicId"></form:hidden>--%>
                                        <%--<form:input path="clinicItemDict.itemName" id="clinicItemDict"   data-parsley-required="true" htmlEscape="false" class="form-control"  maxlength="50" />--%>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">执行科室：</label>
                                    <div class="col-sm-4">
                                        <sys:treeselect selectedParent="true" id="orgDeptId" name="performedBy" update="false" value="${labVsClinic.orgDept.id}"   labelName="${labVsClinic.orgDept.deptName}" labelValue="${labVsClinic.orgDept.deptName}"
                                                        title="科室" url="/sys/orgDept/treeData" extId="${orgDept.id}" cssClass="form-control" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">备注信息：</label>
                                    <div class="col-sm-4">
                                        <form:textarea path="remarks" htmlEscape="false" class="form-control"  maxlength="500"></form:textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-sm-10">
                                        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存">&nbsp;
                                        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="loadDiv('mainCenterDiv','${ctx}/oper/labVsClinic/labVsClinicList')">
                                </div>
                            </div>
                        </form:form>
                    </div>

                </div>
            </section>
        </div>
    </div>